package dlut.java;

import java.util.Scanner;

/**
 * 最小乘积子数组，数组元素为0,1,2,4,8,16，32
 */
public class Solution2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int i = 0; i < t; i++) {
            int n = in.nextInt();
            int[] nums = new int[n];
            double[] nums2 = new double[n];
            for (int j = 0; j < n; j++) {
                nums[j] = in.nextInt();
                if (nums[j] != 0){
                    nums2[j] = Math.log(nums[j]);
                }else {
                    nums2[j] = -1;
                }
            }
            int  ansl = 0 , ansr = 0;
            double temp = 0, max = 0;
            for (int left = 0; left < n; left++) {
                if (nums2[left] == -1)
                    continue;
                int right = left;
                temp = 0;
                while (right < n && nums2[right] >= 0){
                    temp += nums2[right];
                    right ++;
                }
                if (temp > max + 0.01){
                    ansl = left;
                    ansr = right - 1;
                    max = temp;
                }
            }
            System.out.println((ansl+1) + " " + (ansr + 1));
        }
    }
}
